package com.ts.api.module.api.convert.core.annotation;

/**
 *  API对接-H5上游渠道产品模式枚举
 */
public enum ApiChannelMarketConvertType {

    /** 空 */
    NULL(ChannelMarketChooseType.NULL, null, null, ""),

    /** MD5模式 */
    DATA_EXCHANGE_MD5(ChannelMarketChooseType.DATA_EXCHANGE, 0, "channelMarketMd5Adapter", "md5:"),
    /** 手机号掩码模式 */
    DATA_EXCHANGE_PHONE_MASK_8(ChannelMarketChooseType.DATA_EXCHANGE,1, "channelMarketPhoneMask8Adapter", "phoneMask8:"),
    /** 手机号掩码模式 */
    DATA_EXCHANGE_PHONE_MASK_9(ChannelMarketChooseType.DATA_EXCHANGE,2, "channelMarketPhoneMask9Adapter", "phoneMask9:"),
    /** 手机号掩码模式 */
    DATA_EXCHANGE_PHONE_MASK_10(ChannelMarketChooseType.DATA_EXCHANGE,3, "channelMarketPhoneMask10Adapter", "phoneMask10:"),
    /** 用户资质撞库 */
    DATA_EXCHANGE_FORM(ChannelMarketChooseType.DATA_EXCHANGE,4, "channelMarketUserFormAdapter", "userForm:"),

    /** 联登模式-手机号登录 */
    FEDERATE_LOGIN(ChannelMarketChooseType.FEDERATE,1, "channelMarketFederateAdapter", "federatePhone:"),
    /** 联登模式-用户资质登录 */
    FEDERATE_USER_FORM(ChannelMarketChooseType.FEDERATE,2, "channelMarketFederateUserFormAdapter", "federateUserForm:"),
    /** 联登模式-联登跳下游贷超 */
    FEDERATE_TO_CONSUMER_MARKET(ChannelMarketChooseType.FEDERATE,2, "channelMarketFederateToConsumerMarketAdapter", "federatePhoneToConsumerMarket:"),
    ;

    /** 0撞库1联登 */
    private ChannelMarketChooseType chooseType;
    /** 类型值 */
    private Integer type;
    /** 默认对接器 */
    private String defaultBeanName;
    /** 前缀名称 */
    private String prefixBeanName;

    /**
     * 构造函数
     *
     * @param type
     */
    ApiChannelMarketConvertType(ChannelMarketChooseType chooseType, Integer type, String defaultBeanName, String prefixBeanName) {
        this.chooseType = chooseType;
        this.type = type;
        this.defaultBeanName = defaultBeanName;
        this.prefixBeanName = prefixBeanName;
    }

    public Integer getType() {
        return type;
    }

    public String getDefaultBeanName() {
        return defaultBeanName;
    }

    public String getPrefixBeanName() {
        return prefixBeanName;
    }

    public boolean hasType(Integer apiEnvType) {
        return this.getType().equals(apiEnvType);
    }

    public ChannelMarketChooseType getChooseType() {
        return chooseType;
    }

    /**
     *  子枚举
     */
    public enum ChannelMarketChooseType {
        NULL,
        DATA_EXCHANGE,
        FEDERATE,
        ;
    }
}
